package com.bazaaroid.server.gae.core.dto.partner;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.bazaaroid.server.gae.core.persistence.model.partner.Partner;

@XmlRootElement(name = "Partner")
public class PartnerDTO {

	private Partner partner = null;

	public PartnerDTO(){}

	public PartnerDTO(Partner partner) {
		this.partner = partner;
	}

	@XmlElement
	public String getKey() {
		return partner.getKey().toString();
	}

	@XmlElement
	public String getName() {
		return partner.getName();
	}

	@XmlElement
	public String getDescription() {
		return partner.getDescription();
	}

	@XmlElement
	public String getImagePath() {
		return partner.getImagePath();
	}

	@XmlElement
	public ContactDTO getContact() {
		return partner.getContact() != null
			? new ContactDTO(partner.getContact())
			: null;
	}

}
